@{
    // By using a tag builder, sub items can alter the
    // menu element. Note how Display is called on the menu
    // items before the tag is actually rendered.

    TagBuilder tag = Tag(Model, "ul");
    tag.AddCssClass("navbar-nav mr-auto");

    foreach (var item in Model.Items)
    {
        tag.InnerHtml.AppendHtml(await DisplayAsync(item));
    }
}

@tag